import React from 'react';
import { StyleSheet, View } from 'react-native';
import {Switch} from 'react-native-switch';
import { normalize } from '../../utils/adapter';

interface CustomSwitchProps {
  value: boolean;
  onValueChange: (value: boolean) => void;
  size?: number;
}

const CustomSwitch: React.FC<CustomSwitchProps> = ({ value, onValueChange, size = normalize(30) }) => {
  return (
    <View style={styles.container}>
      <Switch
        value={value}
        onValueChange={onValueChange}
        disabled={false}
        circleSize={size}
        barHeight={size}
        backgroundActive="#EDEDED"
        backgroundInactive="#EDEDED"
        circleActiveColor={'#FF685A'}
        circleInActiveColor={'#FFB2AD'}
        switchWidthMultiplier={2}
        circleBorderWidth={0}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    alignItems: 'center',
    justifyContent: 'center',
  },
});

export default CustomSwitch;
